Ext.define('WP.view.PageWP', {
    extend: 'Ext.Panel',	
    alias: 'widget.pagewp',
    config: {
        titlePage: null,
	url:null,
	items :[{
		dock : 'top',
		xtype: 'toolbar',
		title: this.titlePage,
		ui   : 'light'
	}]
	
    },

    //load the config of our Ajax page
    initialize: function() {
        this.callParent(arguments);
	this.down('toolbar').setTitle(this.getTitlePage());
	
	var pageToload = this;
	Ext.Ajax.request({
 	        url: pageToload.getUrl(),
		//enable CORS, we have to config the WP blog who's responding to enable CORS request...
		//withCredentials: true,
		//useDefaultXhrHeader: false,
 	        success: function(response, opts) {
 	        	pageToload.setHtml(response.responseText);
 	        }
 	})		
    }
});